<%@ page contentType="text/html; charset=UTF-8"  %>

<!DOCTYPE html>
<html>
<head>
<title>数据字典-科目</title>
    <%@ include file="/common/meta.jsp" %>
	<%@ include file="/common/import.jsp" %>
	<script type="text/javascript" src="${ctx}/js/zbxtools.js"></script>
	<script type="text/javascript" src="${ctx}/js/easyui/extendvalidate.js"></script>
<script type="text/javascript">
	var inputForm = '#inputForm';
	$(function(){
		$(inputForm).form({
		    success:function(data){
		    	var result = jQuery.parseJSON(data);
		    	if(result.flag=='T'){
		    		$.messager.confirm('提交结果', '操作成功', function(){
						parent.colseAdd();// 关闭添加窗口
		    			parent.cateReload();// 刷新列表
					});
		    	}else if(result.flag=='H'){
		    		$.messager.alert('提交结果', result.msg, 'info');
		    	}else{
		    		$.messager.alert('提交结果', '操作失败', 'error');
		    	}        
		    },
		    error:function(messg)  { 
	       	    $.messager.alert('错误提示', messg.responseText, 'error');
	       }  
		});
		$('#cateCname').focus();
	});
	
	function doSubmit(){
		var flag = $(inputForm).form('validate');
		if(flag){
			//ZBXTools.showProcess('正在提交数据...');
			$(inputForm).submit();
		}
	}
</script>
</head>
<body>	
<div id="tip"> </div>
		<form id="inputForm" name="inputForm" method="post" action="${ctx}/dict/cate/save.action">
			<input type="hidden" name="formToken" id="formToken" value="${formToken}"/>
			<input type="hidden" name="cateId" id="cateId" value="${item.cateId}"/>
			<input type="hidden" name="oldCateEname" id="oldCateEname" value="${item.cateEname}"/>
			<table class="datagrid-body" >
			<tr>
				<td class="datagrid-header">科目中文名称<font color=red>*</font></td>
				<td>
					<input id="cateCname" name="cateCname" value="${item.cateCname}"
					class="easyui-validatebox" data-options="required:true,validType:'CHS'" size="40"
					missingMessage="请输入科目中文名称" invalidMessage="请输入中文" />
				</td>
			</tr>
			<tr >
				<td class="datagrid-header">科目标识<font color=red>*</font></td>
				<td>
					<input name="cateEname" id="cateEname" value="${item.cateEname}"
					<c:if test="${item.cateId!=''}"></c:if>
					class="easyui-validatebox" data-options="required:true,validType:'english'" size="40"
					missingMessage="请输入科目标识" invalidMessage="" />				
				</td>
			</tr>
			<tr>
				<td class="datagrid-header">描述</td>
				<td>
					<input id="cateRemark" name="cateRemark"  value="${item.cateRemark}"
					class="easyui-validatebox" data-options="required:false" size="40" validType="length[0,100]" 
					missingMessage="描述" invalidMessage="应为0~100个字" />
				</td>
			</tr>			
			<tr>
				<td class="datagrid-header">状态<font color=red>*</font></td>
				<td>
					<input type="radio" name="cateStatus" id="cateStatus_1" value="1" />启用
					<input type="radio" name="cateStatus"  id="cateStatus_0" value="0" />停用
				</td>
			</tr>
			<tr>
				<td class="datagrid-header"></td>
				<td >&nbsp;</td>
			</tr>					
			<tr>
				<td class="datagrid-header"></td>
				<td >	
					<a href="#" class="easyui-linkbutton" id="bt1" iconCls="icon-save" onclick="doSubmit();">提交</a>
					<a href="#" class="easyui-linkbutton" iconCls="icon-cancel" onclick="parent.colseAdd();"; >取消</a>	
				</td>
			</tr>
			</table>
		</form>


</body>
</html>


<script>
	ZBXTools.initRadio("cateStatus","${item.cateStatus}");
</script>